<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>jQuery unload()事件示例</title>
		<script src="js/jquery-3.6.1.min.js"></script> 
		<script>
		$(document).ready(function(){
            $(window).unload(function(){
                alert("页面已被刷新！");
            });
		});
        </script>   
    </head>
    <body>
        <h3>jQuery unload()事件示例</h3>
        <hr>
        <p>当用户刷新页面时会弹出消息警告框。</p>
    </body>
</html>